{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/yuanhao/anaconda3/lib/python3.6/site-packages/sklearn/cross_validation.py:44: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.\n",
      "  \"This module will be removed in 0.20.\", DeprecationWarning)\n",
      "/home/yuanhao/anaconda3/lib/python3.6/site-packages/sklearn/grid_search.py:43: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. This module will be removed in 0.20.\n",
      "  DeprecationWarning)\n",
      "/home/yuanhao/anaconda3/lib/python3.6/site-packages/sklearn/lda.py:6: DeprecationWarning: lda.LDA has been moved to discriminant_analysis.LinearDiscriminantAnalysis in 0.17 and will be removed in 0.19\n",
      "  \"in 0.17 and will be removed in 0.19\", DeprecationWarning)\n",
      "/home/yuanhao/anaconda3/lib/python3.6/site-packages/sklearn/learning_curve.py:23: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the functions are moved. This module will be removed in 0.20\n",
      "  DeprecationWarning)\n",
      "/home/yuanhao/anaconda3/lib/python3.6/site-packages/sklearn/qda.py:6: DeprecationWarning: qda.QDA has been moved to discriminant_analysis.QuadraticDiscriminantAnalysis in 0.17 and will be removed in 0.19.\n",
      "  \"in 0.17 and will be removed in 0.19.\", DeprecationWarning)\n"
     ]
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import time\n",
    "import datetime \n",
    "from dateutil.parser import parse\n",
    "from datetime import date, timedelta\n",
    "from pandas.tseries.offsets import *\n",
    "\n",
    "from sklearn.model_selection import train_test_split\n",
    "from sklearn import linear_model\n",
    "from sklearn.linear_model import *\n",
    "from sklearn.neighbors import KNeighborsRegressor\n",
    "from sklearn.metrics import mean_squared_error\n",
    "from sklearn import *\n",
    "from catboost import CatBoostRegressor\n",
    "\n",
    "from lightgbm import LGBMRegressor\n",
    "import pickle\n",
    "from lunar import *\n",
    "from copy import deepcopy\n",
    "\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "data = pd.read_csv('holiday_v2.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>virtual_date</th>\n",
       "      <th>hld</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2012-12-31</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2013-01-02</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2013-01-03</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2013-01-04</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  virtual_date  hld\n",
       "0   2012-12-31    0\n",
       "1   2013-01-01    1\n",
       "2   2013-01-02    1\n",
       "3   2013-01-03    1\n",
       "4   2013-01-04    0"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>virtual_date</th>\n",
       "      <th>hld</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1822</th>\n",
       "      <td>2017-12-27</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1823</th>\n",
       "      <td>2017-12-28</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1824</th>\n",
       "      <td>2017-12-29</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1825</th>\n",
       "      <td>2017-12-30</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1826</th>\n",
       "      <td>2017-12-31</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     virtual_date  hld\n",
       "1822   2017-12-27    0\n",
       "1823   2017-12-28    0\n",
       "1824   2017-12-29    0\n",
       "1825   2017-12-30    1\n",
       "1826   2017-12-31    1"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.tail()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "data['virtual_date'] = pd.to_datetime(data['virtual_date'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "data['dow'] = data['virtual_date'].dt.dayofweek"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "data['month'] = data['virtual_date'].dt.month\n",
    "data['day'] = data['virtual_date'].dt.day"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "data = data.reset_index()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "holiday_df = pd.read_csv('holiday_v2.csv')\n",
    "holiday_df['virtual_date'] = pd.to_datetime(holiday_df['virtual_date'])\n",
    "holiday_series = holiday_df.set_index('virtual_date')\n",
    "\n",
    "data.loc[1:,'yesterday_hld'] = data.loc[1:,'virtual_date'].apply(lambda x: holiday_series.loc[x+DateOffset(days=-1),'hld'])\n",
    "data.loc[0:1825,'tomorrow_hld'] = data.loc[0:1825,'virtual_date'].apply(lambda x: holiday_series.loc[x+DateOffset(days=1),'hld'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "data['ith_workday']=np.nan\n",
    "data['ith_workday_r'] = np.nan\n",
    "for idx, x in data.iterrows():\n",
    "    if idx==0:\n",
    "        data.loc[idx, 'ith_workday'] = 0\n",
    "        continue\n",
    "    elif x['hld']==1:\n",
    "        data.loc[idx, 'ith_workday'] = -1\n",
    "        data.loc[idx, 'ith_workday_r'] = -1\n",
    "        idx_temp, counter = idx-1, 1\n",
    "        while True:\n",
    "            if idx_temp==0 or data.loc[idx_temp, 'hld']==1:\n",
    "                break\n",
    "            data.loc[idx_temp, 'ith_workday_r'] = counter\n",
    "            counter += 1\n",
    "            idx_temp -= 1\n",
    "    elif x['hld']==0 and x['yesterday_hld'] == 1:\n",
    "        data.loc[idx, 'ith_workday'] = 1\n",
    "    else:\n",
    "        data.loc[idx, 'ith_workday'] = data.loc[idx-1, 'ith_workday'] + 1\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>index</th>\n",
       "      <th>virtual_date</th>\n",
       "      <th>hld</th>\n",
       "      <th>dow</th>\n",
       "      <th>month</th>\n",
       "      <th>day</th>\n",
       "      <th>yesterday_hld</th>\n",
       "      <th>tomorrow_hld</th>\n",
       "      <th>ith_workday</th>\n",
       "      <th>ith_workday_r</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>2012-12-31</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>12</td>\n",
       "      <td>31</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>2013-01-01</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>2013-01-02</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>2013-01-03</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>2013-01-04</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>8.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>5</td>\n",
       "      <td>2013-01-05</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>7.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>6</td>\n",
       "      <td>2013-01-06</td>\n",
       "      <td>0</td>\n",
       "      <td>6</td>\n",
       "      <td>1</td>\n",
       "      <td>6</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>6.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>7</td>\n",
       "      <td>2013-01-07</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>7</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>5.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>8</td>\n",
       "      <td>2013-01-08</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>8</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>9</td>\n",
       "      <td>2013-01-09</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>9</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>3.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>10</td>\n",
       "      <td>2013-01-10</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>10</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>11</td>\n",
       "      <td>2013-01-11</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>11</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>12</td>\n",
       "      <td>2013-01-12</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>12</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>13</td>\n",
       "      <td>2013-01-13</td>\n",
       "      <td>1</td>\n",
       "      <td>6</td>\n",
       "      <td>1</td>\n",
       "      <td>13</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>14</td>\n",
       "      <td>2013-01-14</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>14</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>5.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    index virtual_date  hld  dow  month  day  yesterday_hld  tomorrow_hld  \\\n",
       "0       0   2012-12-31    0    0     12   31            NaN           1.0   \n",
       "1       1   2013-01-01    1    1      1    1            0.0           1.0   \n",
       "2       2   2013-01-02    1    2      1    2            1.0           1.0   \n",
       "3       3   2013-01-03    1    3      1    3            1.0           0.0   \n",
       "4       4   2013-01-04    0    4      1    4            1.0           0.0   \n",
       "5       5   2013-01-05    0    5      1    5            0.0           0.0   \n",
       "6       6   2013-01-06    0    6      1    6            0.0           0.0   \n",
       "7       7   2013-01-07    0    0      1    7            0.0           0.0   \n",
       "8       8   2013-01-08    0    1      1    8            0.0           0.0   \n",
       "9       9   2013-01-09    0    2      1    9            0.0           0.0   \n",
       "10     10   2013-01-10    0    3      1   10            0.0           0.0   \n",
       "11     11   2013-01-11    0    4      1   11            0.0           1.0   \n",
       "12     12   2013-01-12    1    5      1   12            0.0           1.0   \n",
       "13     13   2013-01-13    1    6      1   13            1.0           0.0   \n",
       "14     14   2013-01-14    0    0      1   14            1.0           0.0   \n",
       "\n",
       "    ith_workday  ith_workday_r  \n",
       "0           0.0            NaN  \n",
       "1          -1.0           -1.0  \n",
       "2          -1.0           -1.0  \n",
       "3          -1.0           -1.0  \n",
       "4           1.0            8.0  \n",
       "5           2.0            7.0  \n",
       "6           3.0            6.0  \n",
       "7           4.0            5.0  \n",
       "8           5.0            4.0  \n",
       "9           6.0            3.0  \n",
       "10          7.0            2.0  \n",
       "11          8.0            1.0  \n",
       "12         -1.0           -1.0  \n",
       "13         -1.0           -1.0  \n",
       "14          1.0            5.0  "
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.head(15)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def most_similar_date(x):\n",
    "    d = x['virtual_date']\n",
    "    temp = d+DateOffset(years=-1)\n",
    "    if d.date()>=date(2016,10,12):\n",
    "        temp = d+DateOffset(years=-2)\n",
    "    for r in range(5):\n",
    "        t2 = data[data['virtual_date']==temp + DateOffset(days=r)].reset_index()\n",
    "        if len(t2)>0:\n",
    "            if t2.loc[0, 'ith_workday']==x['ith_workday']:\n",
    "                return temp + DateOffset(days=r)\n",
    "        t2 = data[data['virtual_date']==temp + DateOffset(days=-r)].reset_index()\n",
    "        if len(t2)>0 and t2.loc[0,'ith_workday']==x['ith_workday']:\n",
    "            return temp + DateOffset(days=r)\n",
    "    return temp"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "data['s_date'] = data.apply(lambda x:most_similar_date(x), axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def get_spring_distance(x):\n",
    "    d = x['virtual_date']\n",
    "    y = x['virtual_date'].year\n",
    "    dates={2012:date(2012,1,23),\n",
    "           2013:date(2013,2,10),\n",
    "           2014:date(2014,1,31),\n",
    "           2015:date(2015,2,19),\n",
    "           2016:date(2016,2,8),\n",
    "           2017:date(2017,1,28)}\n",
    "    return (d.date()-dates[y]).days\n",
    "\n",
    "def get_ld_distance(x):\n",
    "    d = x['virtual_date']\n",
    "    y = x['virtual_date'].year\n",
    "    return (d.date()-date(y,5,1)).days\n",
    "\n",
    "def get_nd_distance(x):\n",
    "    d = x['virtual_date']\n",
    "    y = x['virtual_date'].year\n",
    "    return (d.date()-date(y,10,1)).days\n",
    "\n",
    "def get_ny_distance(x):\n",
    "    d = x['virtual_date']\n",
    "    y = x['virtual_date'].year\n",
    "    return (d.date()-date(y,1,1)).days\n",
    "\n",
    "def get_ny_distance2(x):\n",
    "    d = x['virtual_date']\n",
    "    y = x['virtual_date'].year\n",
    "    return (d.date()-date(y+1,1,1)).days"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "data['spring_distance'] = data.apply(lambda x: get_spring_distance(x), axis=1)\n",
    "data['ld_distance'] = data.apply(lambda x: get_ld_distance(x), axis=1)\n",
    "data['nd_distance'] = data.apply(lambda x: get_nd_distance(x), axis=1)\n",
    "data['ny_distance'] = data.apply(lambda x: get_ny_distance(x), axis=1)\n",
    "data['ny_distance2'] = data.apply(lambda x: get_ny_distance2(x), axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "data[['virtual_date','ith_workday','s_date','ith_workday_r','spring_distance',\\\n",
    "     'ld_distance','nd_distance','ny_distance','ny_distance2']].to_csv('data_feature-v2.csv',index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
